package com.hbter630.change;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
@Slf4j
@MapperScan("com.hbter630.change.mapper")
public class ChangeApplication {


    private static String SERVER_PORT;

    @Value("${server.port}")
    public void setDatasourceDruidUsername(String port) {
        SERVER_PORT = port;
    }


    public static void main(String[] args) throws UnknownHostException {


        log.info("\n邮件发送涉及隐私 在application-dev 自行配置否则项目会启动失败-奉海龙");


        String hostAddress = InetAddress.getLocalHost().getHostAddress();
        SpringApplication.run(ChangeApplication.class, args);

        //获取当前电脑的ip
        String localHostIp = InetAddress.getLocalHost().getHostAddress();
        log.info("\n接口文档地址：http://{}:{}/swagger-ui.html",localHostIp,SERVER_PORT);

    }

}
